Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Look up message in notmuch instead of using heavy query #46

Closed
wants to merge 1 commit into from

Conversation

nickwynja
Copy link

Attempts to address #31.

So far this is pretty sloppy but it's the best I've been able to figure out with my limited knowledge of rust and types. In general, the approach is to look up the message in notmuch in each case rather than loading all messages in and looking up in that array.

So far I've been able to defer the heavy query in most cases but I'm stuck and could use some help cleaning this up. I've fallen back to having email_exists_from_id just return a bool since that's all I can wrap my head around. But later in the sync process, we actually need to get the message from the id.

I've found self.emails_from_message() which does what I need but I'm stuck trying to return a message type. With that in place, I could go back and reimplement the local_email.blob_id != remote_email.blob_id check.

In general, this seems to perform substantially faster and I'm close to completely removing the heavy local.all_emails() query but could use some help getting past a few hurdles.

@nickwynja
Copy link
Author

@elizagamedev Any chance that you have to time to take a look here and lend a hand?

@nickwynja
Copy link
Author

I've abandoned this since my approach caused more issues than it solved and I haven't been able to refactor to a different approach.

@nickwynja nickwynja closed this Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant